//
//  SSSOnlinePayCell.m
//  SSSMerchant
//
//  Created by Darker on 2017/3/27.
//  Copyright © 2017年 xnxin. All rights reserved.
//

#import "SSSOnlinePayCell.h"
#import "WaitModel.h"

@implementation SSSOnlinePayCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self addSubViews];
    }
    return self;
}
- (void)addSubViews{
    
    self.contentView.backgroundColor = [UIColor colorWithHex:@"FFFFFF"];
    self.headerImageView = [UIImageView new];
    [self.contentView addSubview:_headerImageView];
    _headerImageView.sd_layout
    .centerYEqualToView(self.contentView)
    .leftSpaceToView(self.contentView,WidthIos6CompeteWithCurrent(17))
    .heightIs(WidthIos6CompeteWithCurrent(20))
    .widthIs(WidthIos6CompeteWithCurrent(20));
    
    _titleLable = [UILabel new];
    _titleLable.textColor = [UIColor colorWithHex:@"BBBBBB"];
    _titleLable.font = [SSSFont systemFontOfSize:13];
    _titleLable.textAlignment = NSTextAlignmentLeft;
    [self.contentView addSubview:_titleLable];
    _titleLable.sd_layout
    .leftSpaceToView(_headerImageView,WidthIos6CompeteWithCurrent(22))
    .centerYEqualToView(self.contentView)
    .widthIs(WidthIos6CompeteWithCurrent(35))
    .heightIs(HeigthIos6CompeteWithCurrent(13));
    
    _discLabel = [UILabel new];
    _discLabel.textColor = [UIColor colorWithHex:@"BBBBBB"];
    _discLabel.font = [SSSFont systemFontOfSize:13];
    _discLabel.textAlignment = NSTextAlignmentLeft;
    [self.contentView addSubview:_discLabel];
    _discLabel.sd_layout
    .leftSpaceToView(self.contentView,WidthIos6CompeteWithCurrent(149))
    .centerYEqualToView(self.contentView)
    .widthIs(WidthIos6CompeteWithCurrent(200))
    .heightIs(HeigthIos6CompeteWithCurrent(13));
    
    //横线
    _lineView = [UIView new];
    _lineView.backgroundColor = [UIColor colorWithHex:@"E6E6E6"];
    [self.contentView addSubview:_lineView];
    _lineView.sd_layout
    .leftEqualToView(_headerImageView)
    .rightSpaceToView(self.contentView,WidthIos6CompeteWithCurrent(17))
    .bottomEqualToView(self.contentView)
    .heightIs(0.5);
    
}
- (void)setOnlineModel:(WaitModel *)onlineModel{
    
    _onlineModel = onlineModel;
    _titleLable.text = _onlineModel.titleName;
    _headerImageView.image = [UIImage imageNamed:_onlineModel.headerImageStr];
    _discLabel.text = _onlineModel.subStr;
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
